(function(lib,config){
	/*
    config = {
        typeid: '1',// 弹窗类型 1=固定 2=全屏 3=锚点(保留)
        words: '话术1|话术2|话术3',
        bgcolor: '#ab2626|#333333',
        textcolor: '#9e3636|#ffffff',
        imglink: '/upload/20180521/201805211045251799.png|/upload/20180521/201805211045251799.png',
        weblink: '',// 商务通链接 注意：多个
        flashid: '0',// 保留
        positionid: '5',// 位置 当typeif=1时有效 (将屏幕分割成九宫格)取值：1~9 1=左上 2=左中 3=左右 4=中左 5=中中 6=中右 7=下左 8=下中 9=下右
        firsttime: '10',// 首次弹出时间 单位：秒 
        relapsetime: '30',// 普通弹出时间 单位：秒 0=关闭
        eachtime: '20', // 弹出后显示时间 单位：秒
        iscomapp: '1', //是否兼容百度 0=否 1=是
        identifier: 'centerswt'// 进入商务通的标识符
    };
    */
	
	/* words bgcolor textcolor imglink 可能有多个，用管道符号 | 分割*/
	var loadFunc=function(){
		var textAry=config.words.split('|'),bgcolorAry=config.bgcolor.split('|'),textcolorAry=config.textcolor.split('|'),imglinkAry=config.imglink.split('|'),weblinkAry=config.weblink.split('|');
		imglinkAry[0] = imglinkAry[0]||'/images/swt_people.png';
		/*TODO 方法*/
		function getscrollTop(){ 
		var scrollTop=0;
		if(document.documentElement&&document.documentElement.scrollTop)
		{
			return document.documentElement.scrollTop;
		}
		 if(document.body.scrollTop)
		{
			return document.body.scrollTop;
		}
		
	}
	function getClientHeight(){
		var clientHeight=0;
		if(document.body.clientHeight&&document.documentElement.clientHeight)
		{
			var clientHeight = (document.body.clientHeight<document.documentElement.clientHeight)?document.body.clientHeight:document.documentElement.clientHeight;        
		}
		else
		{
			var clientHeight = (document.body.clientHeight>document.documentElement.clientHeight)?document.body.clientHeight:document.documentElement.clientHeight;    
		}
		return clientHeight;
	}
	function addEvent(obj,type,fn){
		if(obj.attachEvent){
			obj.attachEvent('on'+type,function(){
				fn.call(obj);
			})
		}else{
			obj.addEventListener(type,fn,false);
		}
	}
	var strVar = [] ;	
	var _ua = navigator.userAgent,_ua_text = false,_position = "fixed"; 
	if(_ua.indexOf('baiduboxapp')>-1){
		_ua_text = true;_position = "absolute";
	}
	strVar.push("<style>");    
    strVar.push("    .clear{clear: both;}");
    strVar.push("    .animated{-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-fill-mode:both;animation-fill-mode:both}");
    strVar.push("    @-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}");
    strVar.push("    .fadeIn{-webkit-animation-name:fadeIn;animation-name:fadeIn}");
    strVar.push("    @-webkit-keyframes my-color-tl11{0%{background-color:#83003e}50%{background-color:#FFB42A;color:#e60012}100%{background-color:#83003e}}");
    strVar.push("    @-moz-keyframes my-color-tl11{0%{background-color:#83003e}50%{background-color:#FFB42A;color:#e60012}100%{background-color:#83003e}}");
    strVar.push("    @-ms-keyframes my-color-tl11{0%{background-color:#83003e}50%{background-color:#FFB42A;color:#e60012}100%{background-color:#83003e}}");
    strVar.push("    @-o-keyframes my-color-tl11{0%{background-color:#83003e}50%{background-color:#FFB42A;color:#e60012}100%{background-color:#83003e}}");
    strVar.push("    @keyframes my-color-tl11{0%{background-color:#83003e}50%{background-color:#FFB42A;color:#e60012}100%{background-color:#83003e}}");
    strVar.push("    .my-color-tl11{ -webkit-animation:my-color-tl11 1s ease infinite; -moz-animation:my-color-tl11 1s ease infinite; -o-animation:my-color-tl11 1s ease infinite; -ms-animation:my-color-tl11 1s ease infinite; animation:my-color-tl11 1s ease infinite;}");
    strVar.push("    .swt_foot_1111{width:100%;position:"+ _position +";bottom:0;left:50%;margin-left:-50%;font-family:'microsoft yahei';overflow: inherit;z-index:10021;}");
    strVar.push("    .swt_hos_span{width:18px;height:18px;background: #83003e;-webkit-border-radius: 18px;-moz-border-radius: 18px;-o-border-radius: 18px;border-radius: 18px;line-height: 18px;text-align: center;color:#ffffff;position: absolute;z-index: 10002;top:-180px;}");
    strVar.push("    .swt_hos_close{width:18px;height:18px;background:#999;position:absolute;overflow:hidden;-webkit-border-radius:18px;-moz-border-radius:18px;border-radius:18px;left:5px;z-index: 10002;top:-125px;}");
    strVar.push("    .swt_hos_close::after,.swt_hos_close::before{content:'';position:absolute;height:1px;width:80%;top:50%;left:10%;background:#fff}");
    strVar.push("    .swt_hos_close::before{-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}");
    strVar.push("    .swt_hos_close::after{-webkit-transform:rotate(-45deg);-moz-transform:rotate(-45deg);-ms-transform:rotate(-45deg);-o-transform:rotate(-45deg);transform:rotate(-45deg)}");
    strVar.push("    .swt_foot_1111 .swt_hos_1111{width:93px;height:93px;border:2px solid #ff8b03;background: #ffffff url(\""+imglinkAry[0]+"\") no-repeat 19px 10px;-webkit-border-radius: 93px;-moz-border-radius: 93px;-o-border-radius: 93px;border-radius: 93px;position: absolute;left:0;bottom:96px;z-index: 10001;}");
    strVar.push("    .swt_foot_1111 .swt_bottom_1111{width:0;height:0;background: #f2f2f2;-webkit-border-radius: 20px;-moz-border-radius: 20px;-o-border-radius: 20px;border-radius: 20px;z-index: 1000;position: absolute;left:10px;top:-170px;overflow: hidden;border:1px solid #928d8d}");
    strVar.push("    .swt_foot_1111 .swt_bottom_1111 p{font-size: 20px;min-height:44px;color:#666666;line-height: 30px;padding:3% 30px 0 100px;}");
    strVar.push("    .swt_foot_1111 .swt_bottom_1111 p i{color:#e60012;font-style: normal;}");
    strVar.push("    .swt_foot_1111 .swt_bottom_1111>ul{width:96%;margin:0 auto;margin-top: 15px;margin-bottom: 15px;position: relative;}");
    strVar.push("    .swt_foot_1111 .swt_bottom_1111>ul>li{width:30%;height:44px;line-height:44px;float:left;color: #414141;background: #84003e;margin-left: 2%;display: inline;-webkit-border-radius: 10px;-moz-border-radius: 10px;-o-border-radius: 10px;border-radius: 10px;-webkit-box-shadow: 0 1px 1px #d1d1d1;-moz-box-shadow: 0 1px 1px #d1d1d1;-o-box-shadow: 0 1px 1px #d1d1d1;box-shadow: 0 1px 1px #d1d1d1;font-size: 20px;}.swt_foot_1111 .swt_bottom_1111>ul>li:nth-child(1){background:#ff8a00;}");
    strVar.push("    .swt_foot_1111 .swt_bottom_1111>ul>li>a{color: #ffffff;text-decoration: none;display: block;padding-left: 35px;}");
    strVar.push("    .swt_foot_1111 .swt_bottom_1111>ul>li>a>span{width:24px;height:24px;display: block;float:left;margin-top: 10px;margin-right: 5px;}");
    strVar.push("    .swt_foot_1111 .swt_bottom_1111>ul>li:nth-child(1)>a>span{background: url() no-repeat;}");
    strVar.push("    .swt_foot_1111 .swt_bottom_1111>ul>li:nth-child(2)>a>span{background: url()no-repeat;}");
    strVar.push("    .swt_foot_1111 .swt_bottom_1111>ul>li:nth-child(3)>a>span{background: #83003e;-webkit-border-radius: 24px;-moz-border-radius: 24px;-o-border-radius: 24px;border-radius: 24px;line-height: 24px;text-align: center;color:#ffffff;}");
    strVar.push("    .swt_foot_1111 .swt_bottom_1111>ul:after{clear: both;}");
    strVar.push("    .swt_bottom_tran{-webkit-transition:all .6s;-moz-transition:all .6s;-o-transition:all .6s;transition:all .6s;}");   
    strVar.push("    @media screen and (max-width: 559px) and (min-width: 480px){");
    strVar.push("        .swt_foot_1111 .swt_bottom_1111 p{font-size: 16px;}");
    strVar.push("        .swt_foot_1111 .swt_bottom_1111>ul{margin-top: 8px;margin-bottom: 8px;}");
    strVar.push("        .swt_foot_1111 .swt_bottom_1111>ul>li{height:36px;line-height:36px;font-size: 16px;}");
    strVar.push("        .swt_foot_1111 .swt_bottom_1111>ul>li>a{padding-left:14px;}");
    strVar.push("        .swt_foot_1111 .swt_bottom_1111>ul>li>a>span{width:20px;height:20px;margin-top: 8px;margin-right: 2px;}");
    strVar.push("        .swt_foot_1111 .swt_bottom_1111>ul>li:nth-child(1)>a>span{background-size: 100%;}");
    strVar.push("        .swt_foot_1111 .swt_bottom_1111>ul>li:nth-child(2)>a>span{background-size: 100%;}");
    strVar.push("        .swt_foot_1111 .swt_bottom_1111>ul>li:nth-child(3)>a>span{-webkit-border-radius: 20px;-moz-border-radius: 20px;-o-border-radius: 20px;border-radius: 20px;line-height: 20px;}");
    strVar.push("    }");
    strVar.push("    @media screen and (max-width: 479px) and (min-width: 376px){");
    strVar.push("        .swt_foot_1111 .swt_hos_1111{width:70px;height:70px;-webkit-border-radius: 70px;-moz-border-radius: 70px;-o-border-radius: 70px;border-radius: 70px;position: absolute;left:0;bottom:96px;background-size:66%;background-position: 15px 11px;bottom:76px;}");
    strVar.push("        .swt_foot_1111 .swt_bottom_1111{width:0;height:0;top:-140px;}");
    strVar.push("        .swt_foot_1111 .swt_bottom_1111 p{font-size: 16px;padding:5px 8px 0 72px;line-height: 24px;}");
    strVar.push("        .swt_foot_1111 .swt_bottom_1111>ul{margin-top: 16px;margin-bottom:10px;}");
    strVar.push("        .swt_foot_1111 .swt_bottom_1111>ul>li{height:36px;line-height:36px;font-size: 14px;}");
    strVar.push("        .swt_foot_1111 .swt_bottom_1111>ul>li>a{padding-left:14px;}");
    strVar.push("        .swt_foot_1111 .swt_bottom_1111>ul>li>a>span{width:20px;height:20px;margin-top: 8px;margin-right: 2px;}");
    strVar.push("        .swt_foot_1111 .swt_bottom_1111>ul>li:nth-child(1)>a>span{background-size: 100%;}");
    strVar.push("        .swt_foot_1111 .swt_bottom_1111>ul>li:nth-child(2)>a>span{background-size: 100%;}");
    strVar.push("        .swt_foot_1111 .swt_bottom_1111>ul>li:nth-child(3)>a>span{-webkit-border-radius: 20px;-moz-border-radius: 20px;-o-border-radius: 20px;border-radius: 20px;line-height: 20px;}");
    strVar.push("        .swt_hos_span{top:-150px;left:5px;}");
    strVar.push("        .swt_hos_close{top:-100px;left:1px;}");
    strVar.push("    }");
    strVar.push("    @media screen and (max-width: 375px) and (min-width: 319px){");
    strVar.push("        .swt_foot_1111 .swt_hos_1111{width:70px;height:70px;-webkit-border-radius: 70px;-moz-border-radius: 70px;-o-border-radius: 70px;border-radius: 70px;position: absolute;left:0;bottom:47px;background-size:66%;background-position: 15px 11px;}");
    strVar.push("        .swt_foot_1111 .swt_bottom_1111{width:0;height:0;top:-90px;-webkit-border-radius: 15px;-moz-border-radius: 15px;-o-border-radius: 15px;border-radius: 15px;}");
    strVar.push("        .swt_foot_1111 .swt_bottom_1111 p{font-size: 14px;padding:4px 3px 0 65px;line-height: 20px;}");
    strVar.push("        .swt_foot_1111 .swt_bottom_1111>ul{margin-top: 5px;margin-bottom: 5px;margin-left:10px;}");
    strVar.push("        .swt_foot_1111 .swt_bottom_1111>ul>li{height:28px;line-height:28px;font-size: 14px;}");
    strVar.push("        .swt_foot_1111 .swt_bottom_1111>ul>li>a{padding-left:8px;}");
    strVar.push("        .swt_foot_1111 .swt_bottom_1111>ul>li>a>span{width:16px;height:16px;margin-top: 5px;margin-right: 2px;}");
    strVar.push("        .swt_foot_1111 .swt_bottom_1111>ul>li:nth-child(1)>a>span{background-size: 100%;}");
    strVar.push("        .swt_foot_1111 .swt_bottom_1111>ul>li:nth-child(2)>a>span{background-size: 100%;}");
    strVar.push("        .swt_foot_1111 .swt_bottom_1111>ul>li:nth-child(3)>a>span{-webkit-border-radius: 16px;-moz-border-radius: 16px;-o-border-radius: 16px;border-radius: 16px;line-height: 16px;}");
    strVar.push("        .swt_hos_span{top:-115px;left:5px;}");
    strVar.push("        .swt_hos_close{top:-70px;left:1px;}");
    strVar.push("    }");
    strVar.push("<\/style>");
	strVar.push('<div class="swt_foot_1111" id="swt_foot_1111">');	
	strVar.push('	<div class="swt_hos_close" id="swt_hos_close"></div>');
	strVar.push('	<a href="javascript:void(0)" onclick="openZoosUrl(\''+ config.identifier+'\')"> <div class="swt_hos_1111"></div></a>');
	strVar.push('	<div class="swt_bottom_1111 swt_bottom_tran" id="swt_bottom_20161111">');
	strVar.push('		<p onclick="openZoosUrl(\''+ config.identifier+'\')" id=\"swt_bottom_p\"> </p>');
	strVar.push('		<ul id="swt_foot_ul_1111">');
	strVar.push('			<li><a href="javascript:void(0)" onclick="openZoosUrl(\''+ config.identifier+'\')"><span></span>在线咨询</a></li>');
	strVar.push('			<li><a href="tel:087165389555"><span></span>免费拨打</a></li>');
	strVar.push('			<li><a href="javascript:void(0)" onclick="openZoosUrl(\''+ config.identifier+'\')"><span class="my-color-tl11">8</span>剩余号位</a></li>');
	strVar.push('			<div class="clear"></div>');
	strVar.push('		</ul>');
	strVar.push('	</div>');
	strVar.push('	<div class="swt_hos_span my-color-tl11">8</div>');
	strVar.push('</div>');
	var o = document.createElement('div');
    o.innerHTML = strVar.join('');
    while(o.firstElementChild){
        document.body.appendChild(o.firstElementChild);
    };
	var _$ = function(id){return document.getElementById(id);}
	
	var swt_text = textAry;	
	var _t = document.title;
	
	var _i_l = swt_text.length -1;
	var  RandomNum= function (Min,Max){
		var Range = Max - Min;
		var Rand = Math.random();
		var num = Min + Math.round(Rand * Range);
		return num;
	}
	var _swt_bottom_20161111 = _$('swt_bottom_20161111');
	var _swt_foot_ul_1111 = _$('swt_foot_ul_1111');
	var _swt_hos_close = _$('swt_hos_close');
	var _swt_foot_1111 = _$('swt_foot_1111');
	var _swt_bottom_p = _$('swt_bottom_p');
	var display = false;
	var _time = function(a,b){
		display = !display;
		var c = display ? a : b;
		var _body = document.body.offsetWidth,_height;
		if(_body>=640){
			_height = 158;
		}else if( _body < 640 && _body >= 560){
			_height = 150;
		}
		else if( _body < 560 && _body >= 480){
			_height = 130;
		}
		else if( _body < 480 && _body >= 376){
			_height = 120;
		}
		else{
			_height = 86;
		}
		setTimeout(function(){
			_swt_bottom_p.innerHTML = swt_text[RandomNum(0,_i_l)];
			_swt_bottom_20161111.style.width = display ? "95%":'0';
			_swt_bottom_20161111.style.height =  display ? _height + "px":'0';
			_swt_foot_ul_1111.className = display ?  'fadeIn animated' : '';
			_time(a,b);
		},c)
	}
	var _time_var = _time(config.firsttime * 1000,config.relapsetime *1000);
	_swt_hos_close.onclick = function(){
		_swt_foot_1111.style.display = 'none';
		clearTimeout(_time_var);
		setTimeout(function(){
			_swt_foot_1111.style.display = 'block';
		},config.relapsetime * 1000)
	}
		if(_ua_text){
			var _t_box = _swt_foot_1111.style.bottom;
			if(_t_box==''){_t_box=0;}
			addEvent(window,'scroll',function(){
				_swt_foot_1111.style.bottom = parseInt(_t_box)-(getscrollTop()/getClientHeight())*100 + '%' ;
				
			})
			
		}
		
	};
	lib.load(loadFunc);/*执行代码*/
})('{{lib}}','{{config}}');